home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Utils□□□ Divers 2 / MacCurveFit 1.2 / MacCurveFit Tuts / MacCurveFit Tuts.rsrc / TEXT_129.txt < prev    next >
Text File  |  1995-09-02  |  4KB  |  245 lines

  1. Tutorial 2.
  2.  
  3. This tutorial demonstrates the use of those funny icons in the top left corner of the data window.  Start up MacCurveFit and open the file ΓÇ£Reactor TempΓÇ¥ (in the examples folder).  Since the basics have been covered in Tutorial 1 youΓÇÖll forgive me for not going through the tedium again.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. The window contains temperature data from a microwave chemical reactor that has been rapidly heated, held at a constant temperature for a while and finally cooled using a patented cooling device.  Column A lists the time in seconds since the reactor was switched on and column B is the temperature in degrees Celcius.
  30.  
  31. Plot the temperature against the time and youΓÇÖll get a plot like the one on the top of the next page.  Because of the large number of temperature measurements the plot looks quite unattractive.  You can remedy this by changing the plot symbols to single pixels.  You can also label the axes and give the plot a title.  Your spruced up plot should look like the one at the bottom of the next page.
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. Next select the data window to bring it to the front.  Make the cell A1 the active cell then scroll the window to show the cell A108.  Hold down the shift key and click cell A108, you should now have a range of cells selected.  Click the left small icon in the top left corner of the data window and observe the plot.  All of the points before 540 seconds disappear from view as shown below.
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112. Click the left icon again and the points will return.  LetΓÇÖs fit an exponential decay to the cooling part of the curve.  While the range A1:A108 is still selected click on the right icon.  The plot will look no different however the points will not be considered when curve fitting.
  113.  
  114. Open the curve fit window and select the function ΓÇ£exp decayΓÇ¥ from the function popup menu.  Set the value of coefficient a to 100 and b to 0.01.  The function will be plotted as shown on the top of the next page.  Since our temperature curve doesnΓÇÖt decay to zero edit the function text to read
  115.  
  116.  
  117.  
  118. Press the enter key and then set the value of coefficient c to 20.  Also, since the start of the cooling is at 540 seconds, edit the function again to read:
  119.  
  120.  
  121.  
  122.  
  123.  
  124. and then press the enter key.  The more astute reader will notice that the two functions above are equivalent.  However the latter gives better performance in curve fitting.  Whenever the optimum coefficients are different by several orders of magnitude the algorithms in MacCurveFit may terminate prematurely.  (Try curve fitting with the first function).  As a general tip try and construct your functions so that this situation doesnΓÇÖt arise.
  125.  
  126. Next click the Fit button.  The resulting plot is shown on the bottom of the next page.
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179. The optimum values of the coefficients will be:
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. The sum of squares error was reduced to 1824.3 and the correlation coefficient (R2) was.0.99215.
  187.  
  188. Now suppose you wanted to calculate the predicted y values for times greater than 540 seconds.  The equation yielding the values is:
  189.  
  190.  
  191.  
  192.  
  193. however calculating this for more than two hundred data points would be rather tedious.  MacCurveFit 1.1 can automate this process as follows.  
  194.  
  195. Make sure the data cells A1:A108 still have the right small icon disabled.  This not only masks the cells from curve fitting but also from the automatic prediction of y values.  Set the data column C for fixed point format to two decimal places.  Then bring the fit window to the front and choose Predict Batch YΓǪ from the Fit menu.  Select Time (s) as the x data and Column C as the output column as shown below.
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216. Click the Calculate button and the predicted y values will appear in column C of the Reactor Temp data window as shown on the next page.
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242. That concludes this tutorial.
  243.  
  244.  
  245.